module.exports = function ($scope, $resource, $modalInstance, travel, checkFlag) {

    $scope.checkFlag = checkFlag;
    $resource('/api/as/goc/outboundtravel/getTravelInfo', {}, {}).save({'group_code': travel.group_code}, function(res){
        if (res.errcode === 0) {
            $scope.group = res.data;
        } else {
            toaster.error({title: '', body: '查询失败'});
        }
    });

    $scope.close = function () {
        $modalInstance.dismiss('cancel');
    }

    $scope.setTravelStatus = function (status){
        var para = {
            'group_code': travel.group_code,
            'status': status
        }
        $resource('/api/ac/goc/outboundTravelService/setTravelStatus', {}, {}).save(para, function(res){
            if (res.errcode === 0) {
                toaster.success({title: '', body: '成功'});
                $modalInstance.close(status);
            } else {
                toaster.error({title: '', body: '审核失败'});
            }
        });
    }


};